﻿<!--
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.
-->

<phone:PhoneApplicationPage
    x:Class="PhoneToolkitSample.Samples.MapsSample"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:maptk="clr-namespace:Microsoft.Phone.Maps.Toolkit;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:maps="clr-namespace:Microsoft.Phone.Maps.Controls;assembly=Microsoft.Phone.Maps"        
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <maps:Map x:Name="Map" Grid.Row="1" Hold="OnMapHold">
            <maptk:MapExtensions.Children>
                <maptk:Pushpin x:Name="RouteDirectionsPushPin" Visibility="Collapsed"/>
                <maptk:MapItemsControl Name="StoresMapItemsControl">
                    <maptk:MapItemsControl.ItemTemplate>
                        <DataTemplate>
                            <maptk:Pushpin GeoCoordinate="{Binding GeoCoordinate}" Visibility="{Binding Visibility}" Content="{Binding Address}"/>
                        </DataTemplate>
                    </maptk:MapItemsControl.ItemTemplate>
                </maptk:MapItemsControl>
                <maptk:UserLocationMarker x:Name="UserLocationMarker" Visibility="Collapsed"/>
            </maptk:MapExtensions.Children>
        </maps:Map>

    </Grid>

    <!-- ApplicationBar -->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/app_bar_me_icon.png" Text="Me" Click="OnMe"/>
            <shell:ApplicationBarIconButton IconUri="/Images/maps.appbar.directions.dark.png" Text="Show Route" Click="OnShowRoute"/>

            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="Hide Stores" Click="OnHideStores"/>
                <shell:ApplicationBarMenuItem Text="Show Stores" Click="OnShowStores" IsEnabled="False"/>
                <shell:ApplicationBarMenuItem Text="Get directions" Click="OnDirections"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>